import Vue from "vue";
import VueRouter from "vue-router";
Vue.use(VueRouter);

const routes = [
  {
    path:'',
    redirect: '/main',
  },
  {
    path:'/login',
    name:'LoginPage',
    component:()=>import('../views/login.vue')
  },
  {
    path: '/home',
    name: 'home',
    component: () => import("../views/home.vue"),
    children:[
      {
        path:'/main',
        name:'mainPage',
        component:()=>import('../views/main.vue')
      },
      {
        path:'/mistake',
        name:'MistakePage',
        component:()=>import('../views/mistakePage.vue')
      },
      {
        path:'/practice',
        name:'PracticePage',
        component:()=>import('../views/PracticePage.vue')
      },
      {
        path:'/statistics',
        name:'statistics',
        component:()=>import('../views/statistics.vue')
      },
      {
        path:'/label',
        name:'label',
        component:()=>import('../views/label.vue')
      },
    ]
  },
  {
    path:'/login',
    name:'Login',
    component:()=>import('../views/mistakePage.vue')
  },

];

const router = new VueRouter({
  mode: 'history',
  routes,
});


export default router;
